#ifndef SCRIPT_SEMANTIC_ANALYZER_H
#define SCRIPT_SEMANTIC_ANALYZER_H

#include <global.h>
#include "script_header.h"

namespace script
{
class ScriptSemanticAnalyzerData;

/**
 * @brief:  语义分析器，分析内容包括：
 *          类型检查、作用域检查、循环和条件语句的语义检查、异常处理等
 * @author: sherlock_lht
 */
class ScriptSemanticAnalyzer
{
public:
    explicit ScriptSemanticAnalyzer();
    ~ScriptSemanticAnalyzer();

    /**
     * @brief:  分析ast语法树
     * @author: sherlock_lht
     */
    bool analyze(const ASTNode &ast_node);

    ErrorInfo getErrorInfo() const;

private:
    DECLARE_DATA(ScriptSemanticAnalyzer)
};
}


#endif //SCRIPT_SEMANTIC_ANALYZER_H
